/*! 
 * Header file for a material.
 *
 * \author Devis Rossini
 * \date 13 April 2012
 */
#ifndef PHXMATERIAL_H_INCLUDE_GUARD 
#define PHXMATERIAL_H_INCLUDE_GUARD

#include "PhxCore.h"

namespace phx
{
	/*!
     * Represents a material, holding all collision's parameters.
     */
    class Material
    {
	public:

		Material() 
			: mFriction(0), mRestituition(0), mTolerance(0) { }

		Material(real iFriction, real iRestitution, real iTolerance)
			: mFriction(iFriction), mRestituition(iRestitution), mTolerance(iTolerance) { }

		const static Material DEFAULT_MATERIAL; 

		/*!
         * Get material's friction value.
         */
		inline real GetFriction() const 
		{ 
			return mFriction; 
		}

		/*!
         * Set material's friction value.
         */
		inline void SetFriction(real iFriction) 
		{ 
			mFriction = iFriction; 
		}

		/*!
         * Get material's restitution value.
         */
		inline real Restituition() const 
		{ 
			return mRestituition; 
		}

		/*!
         * Set material's restitution value.
         */
		inline void Restituition(real iRestitution) 
		{ 
			mRestituition = iRestitution; 
		}

		/*!
         * Get material's tolerance value.
         */
		inline real GetTolerance() const 
		{ 
			return mTolerance; 
		}
		
		/*!
         * Set material's tolerance value.
         */
		void SetTolerance(real iTolerance) 
		{ 
			mTolerance = iTolerance; 
		}

		/*!
         * Set all material's parameters.
         */
		void setAll(real iFriction, real iRestitution, real iTolerance)
		{
			mFriction = iFriction;
			mRestituition = iRestitution;
			mTolerance = iTolerance;
		}


	protected:

        /*!
         * Contact friction.
         */
        real mFriction;

		/*!
         * Contact restitution.
         */
        real mRestituition;

		/*!
         * Contact tolerance.
         */
        real mTolerance;
	};
}

#endif // PHXMATERIAL_H_INCLUDE_GUARD